package com.ht.medicaltreatment.activity

import androidx.activity.viewModels
import androidx.recyclerview.widget.LinearLayoutManager
import com.gym.baselib.base.BaseActivity
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.adapter.RecordDetailAdapter
import com.ht.medicaltreatment.viewmodel.RecordDetailViewModel
import kotlinx.android.synthetic.main.activity_record_detail_layout.*

class RecordDetailActivity:BaseActivity() {
    private val model by viewModels<RecordDetailViewModel>()
    private lateinit var adapter: RecordDetailAdapter

    override fun getLayoutId() = R.layout.activity_record_detail_layout

    override fun init() {
        setTitle("样本详情")
        val id = intent.getIntExtra("id",0)
        recyclerView.layoutManager = LinearLayoutManager(this)
        adapter = RecordDetailAdapter()
        recyclerView.adapter = adapter
        model.getList("$id"){
            adapter.setNewInstance(it)
        }
    }

}
